import { defineStore } from "pinia"

export const useCountStore = defineStore('count',{
    //actions里放的是一个个的动作，用于相应组件中的动作
    actions:{
        increment(val:number){
            this.sum += val
        }
    },
    state() {
        return {
            sum:10,
            school:'atguigu',
            address:'xxxx'
        }
    },
    getters:{
        bigSum:state => state.sum * 10 ,
        upperSchool():string{
            return this.school.toUpperCase()
        }
    }
})